package com.molamil.outboard {
	import flash.events.Event;
	import flash.events.EventDispatcher;

	/**
	 * @author martindyrby
	 */
	public class EventEntry extends AbstractEntry {
		public var type:String;
		public var dispatcher:EventDispatcher;
		public var callback : Function;
		public var recordingListener : Function;
	
		public function EventEntry() {}
	
		override public function init() : void {
			dispatcher.addEventListener(type, listener, false, 0, true);
		}
	
		protected function listener(event : Event) : void {
			recordingListener(callback, null);
			callback();
		}
		
		
	
		override public function destroy() : void {
			dispatcher.removeEventListener(type, listener);	
		}
	}
}
